package workTest;

public abstract class Animal {
     String name;
     double weight;
     double force;

    public Animal(String name, double weight, double force) {
        this.name = name;
        this.weight = weight;
        this.force = force;
    }

    void eat(){
    }
}

class Elephant extends Animal{
    public Elephant(String name, double weight, double force) {
        super(name, weight, force);
    }

    @Override
    void eat() {
        System.out.println("大象开心的吃水果！");
    }
}

class Lion extends Animal{
    public Lion(String name, double weight, double force) {
        super(name, weight, force);
    }

    @Override
    void eat() {
        System.out.println("狮子开心的吃肉！");
    }
}

class AnimalPeo{
    void getfood(Animal animal){
        System.out.println("饲养员正在喂食~~~");
        animal.eat();
    }

    void show(Animal animal,Animal animal2){
        System.out.println(animal.name + "正在表演~~");
        System.out.println(animal2.name + "正在表演~~");
        if (animal.force > animal2.force){
            System.out.println(animal.name + "战斗力更牛逼，获胜了！！！");
        }
    }
}

class TestAnimal{
    public static void main(String[] args) {
        Animal elephant = new Elephant("胖胖",100,80);
        Animal lion = new Lion("酷酷",70,60);
        AnimalPeo animalPeo = new AnimalPeo();
        animalPeo.getfood(elephant);
        animalPeo.getfood(lion);
        animalPeo.show(elephant,lion);
    }
}